# Contributor: Karim Kanso <kaz.kanso@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=daq
pkgver=3.0.13
pkgrel=0
pkgdesc="Data Acquisition library - packet I/O library"
url="https://www.snort.org/"
arch="all"
license="GPL-2.0-only"
makedepends="
	autoconf
	automake
	bison
	flex
	libdnet-dev
	libmnl-dev
	libnetfilter_queue-dev
	libnfnetlink-dev
	libpcap-dev
	libtool
	linux-headers
	"
checkdepends="cmocka-dev"
subpackages="$pkgname-static $pkgname-dev"
source="https://www.snort.org/downloads/snortplus/libdaq-$pkgver.tar.gz"
builddir="$srcdir/libdaq-$pkgver"
options="!check" # requires a wrap for some glibc __functions

prepare() {
	default_prepare
	./bootstrap
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	cd "$pkgdir"
	rm -v usr/bin/daqtest*
}

sha512sums="
56750b2d0ea783fd1527d2d8c9ed4e05db32c4a6adacfd5c23a1e4a9b0de63617a3920a428914b8bb6113dabb6f98ad6da4f0d118809c06a19b58fd72d7f7615  libdaq-3.0.13.tar.gz
"
